package com.ikkong.biz.meta.intercept;

import com.ikkong.biz.service.TeacherService;
import com.ikkong.biz.service.impl.TeacherServiceImpl;
import com.ikkong.core.aop.AopContext;
import com.ikkong.core.jfinal.ext.kit.JsonKit;
import com.ikkong.core.meta.PageIntercept;
import com.ikkong.core.toolbox.Func;
import com.ikkong.core.toolbox.Record;
import com.ikkong.core.toolbox.support.BladePage;

import java.util.List;
import java.util.Map;

/**
 * 查找班主任tree列表
 */
public class ChooseTeacherIntercept extends PageIntercept {
    TeacherService service = new TeacherServiceImpl();
	/**
	 * 查询后附加字典项
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void queryAfter(AopContext ac) {
        List<Record> list = (List<Record>) ac.getObject();
        for (Record r: list
             ) {
            r.set("open",true);
            r.set("chkDisabled",true);
        }
        List<Record> teachers = service.teacherTree();
        list.addAll(teachers);
	}
	
}
